package com.itcast.dao;

import com.github.pagehelper.Page;
import com.itcast.dto.InsertMemberDTO;
import com.itcast.dto.MemberLoginDTO;
import com.itcast.pojo.Member;
import com.itcast.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @className: MemberDao
 * @description: TODO 类描述
 * @author: Jng
 * @date: 2022/4/14
 **/

public interface MemberDao {
    /**
     * 根据电话号码查询会员
     * @param phoneNumber
     * @return
     */
    Member findByTelephone(String phoneNumber);

     void add(Member member1);
     Page<Member> selectByCondition(String queryString);
     void deleteById(Integer id);
     Member findById(Integer id);
     void edit(Member member);
     Integer findMemberCountBeforeDate(String date);
     Integer findMemberCountByDate(String date);
     Integer findMemberCountAfterDate(String date);
     Integer findMemberTotalCount();

    Member login4EmailAndPwd(@Param("phoneNumber") String phoneNumber, @Param("password")String password);

    Page<User> findPage(@Param("queryString") String queryString);

    boolean registerMember(Member member);

    Member getUserDetails(@Param("id") Integer id);

    boolean updateUserDetails(Member member);

    boolean addUser(InsertMemberDTO insertMemberDTO);
}
